.class public Lcom/glympse/platform/Reflection$_SmsManager;
.super Ljava/lang/Object;
.source "Reflection.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/glympse/platform/Reflection;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "_SmsManager"
.end annotation


# static fields
.field private static ms_fLoaded:Z

.field private static ms_oClass_SmsManager:Ljava/lang/Class;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/Class",
            "<*>;"
        }
    .end annotation
.end field

.field private static ms_oMethod_divideMessage:Ljava/lang/reflect/Method;

.field private static ms_oMethod_getDefault:Ljava/lang/reflect/Method;

.field private static ms_oMethod_sendMultipartTextMessage:Ljava/lang/reflect/Method;


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 400
    const/4 v0, 0x0

    sput-boolean v0, Lcom/glympse/platform/Reflection$_SmsManager;->ms_fLoaded:Z

    .line 401
    sput-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oClass_SmsManager:Ljava/lang/Class;

    .line 402
    sput-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_getDefault:Ljava/lang/reflect/Method;

    .line 403
    sput-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_divideMessage:Ljava/lang/reflect/Method;

    .line 404
    sput-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_sendMultipartTextMessage:Ljava/lang/reflect/Method;

    .line 394
    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 394
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static Load()Z
    .locals 8

    .prologue
    const/4 v7, 0x0

    const/4 v6, 0x1

    .line 409
    sget-boolean v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_fLoaded:Z

    if-nez v1, :cond_1

    .line 411
    sput-boolean v6, Lcom/glympse/platform/Reflection$_SmsManager;->ms_fLoaded:Z

    .line 416
    :try_start_0
    const-string v1, "android.telephony.SmsManager"

    invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v1

    sput-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oClass_SmsManager:Ljava/lang/Class;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2

    .line 423
    :goto_0
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oClass_SmsManager:Ljava/lang/Class;

    if-nez v1, :cond_0

    .line 427
    :try_start_1
    const-string v1, "android.telephony.gsm.SmsManager"

    invoke-static {v1}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;

    move-result-object v1

    sput-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oClass_SmsManager:Ljava/lang/Class;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 435
    :cond_0
    :goto_1
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oClass_SmsManager:Ljava/lang/Class;

    if-eqz v1, :cond_1

    .line 437
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "Using "

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    sget-object v2, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oClass_SmsManager:Ljava/lang/Class;

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " to send SMS"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/String;)V

    .line 441
    :try_start_2
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oClass_SmsManager:Ljava/lang/Class;

    const-string v2, "getDefault"

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v1

    sput-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_getDefault:Ljava/lang/reflect/Method;

    .line 442
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oClass_SmsManager:Ljava/lang/Class;

    const-string v2, "divideMessage"

    const/4 v3, 0x1

    new-array v3, v3, [Ljava/lang/Class;

    const/4 v4, 0x0

    const-class v5, Ljava/lang/String;

    aput-object v5, v3, v4

    invoke-virtual {v1, v2, v3}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v1

    sput-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_divideMessage:Ljava/lang/reflect/Method;

    .line 443
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oClass_SmsManager:Ljava/lang/Class;

    const-string v2, "sendMultipartTextMessage"

    .line 444
    const/4 v3, 0x5

    new-array v3, v3, [Ljava/lang/Class;

    const/4 v4, 0x0

    const-class v5, Ljava/lang/String;

    aput-object v5, v3, v4

    const/4 v4, 0x1

    const-class v5, Ljava/lang/String;

    aput-object v5, v3, v4

    const/4 v4, 0x2

    const-class v5, Ljava/util/ArrayList;

    aput-object v5, v3, v4

    const/4 v4, 0x3

    const-class v5, Ljava/util/ArrayList;

    aput-object v5, v3, v4

    const/4 v4, 0x4

    const-class v5, Ljava/util/ArrayList;

    aput-object v5, v3, v4

    .line 443
    invoke-virtual {v1, v2, v3}, Ljava/lang/Class;->getMethod(Ljava/lang/String;[Ljava/lang/Class;)Ljava/lang/reflect/Method;

    move-result-object v1

    sput-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_sendMultipartTextMessage:Ljava/lang/reflect/Method;
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    .line 453
    :cond_1
    :goto_2
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_getDefault:Ljava/lang/reflect/Method;

    if-eqz v1, :cond_2

    .line 454
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_divideMessage:Ljava/lang/reflect/Method;

    if-eqz v1, :cond_2

    .line 455
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_sendMultipartTextMessage:Ljava/lang/reflect/Method;

    if-eqz v1, :cond_2

    move v1, v6

    :goto_3
    return v1

    .line 429
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 431
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_1

    .line 446
    .end local v0           #e:Ljava/lang/Exception;
    :catch_1
    move-exception v1

    move-object v0, v1

    .line 448
    .restart local v0       #e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_2

    .end local v0           #e:Ljava/lang/Exception;
    :cond_2
    move v1, v7

    .line 453
    goto :goto_3

    .line 418
    :catch_2
    move-exception v1

    goto/16 :goto_0
.end method

.method public static divideMessage(Ljava/lang/Object;Ljava/lang/String;)Ljava/util/ArrayList;
    .locals 4
    .parameter "oSmsManager"
    .parameter "text"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Object;",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 481
    invoke-static {}, Lcom/glympse/platform/Reflection$_SmsManager;->Load()Z

    .line 483
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_divideMessage:Ljava/lang/reflect/Method;

    if-eqz v1, :cond_0

    .line 487
    :try_start_0
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_divideMessage:Ljava/lang/reflect/Method;

    const/4 v2, 0x1

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    aput-object p1, v2, v3

    invoke-virtual {v1, p0, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Ljava/util/ArrayList;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-object v1, p0

    .line 495
    :goto_0
    return-object v1

    .line 489
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 491
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    .line 495
    .end local v0           #e:Ljava/lang/Exception;
    :cond_0
    const/4 v1, 0x0

    goto :goto_0
.end method

.method public static getDefault()Ljava/lang/Object;
    .locals 5

    .prologue
    const/4 v4, 0x0

    .line 461
    invoke-static {}, Lcom/glympse/platform/Reflection$_SmsManager;->Load()Z

    .line 463
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_getDefault:Ljava/lang/reflect/Method;

    if-eqz v1, :cond_0

    .line 467
    :try_start_0
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_getDefault:Ljava/lang/reflect/Method;

    const/4 v2, 0x0

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    .line 475
    :goto_0
    return-object v1

    .line 469
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 471
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    .end local v0           #e:Ljava/lang/Exception;
    :cond_0
    move-object v1, v4

    .line 475
    goto :goto_0
.end method

.method public static sendMultipartTextMessage(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Ljava/util/ArrayList;Ljava/util/ArrayList;)V
    .locals 4
    .parameter "oSmsManager"
    .parameter "destinationAddress"
    .parameter "scAddress"
    .parameter
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Object;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/util/ArrayList",
            "<",
            "Ljava/lang/String;",
            ">;",
            "Ljava/util/ArrayList",
            "<",
            "Landroid/app/PendingIntent;",
            ">;",
            "Ljava/util/ArrayList",
            "<",
            "Landroid/app/PendingIntent;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 501
    .local p3, parts:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Ljava/lang/String;>;"
    .local p4, sentIntents:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Landroid/app/PendingIntent;>;"
    .local p5, deliveryIntents:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Landroid/app/PendingIntent;>;"
    invoke-static {}, Lcom/glympse/platform/Reflection$_SmsManager;->Load()Z

    .line 503
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_sendMultipartTextMessage:Ljava/lang/reflect/Method;

    if-eqz v1, :cond_0

    .line 507
    :try_start_0
    sget-object v1, Lcom/glympse/platform/Reflection$_SmsManager;->ms_oMethod_sendMultipartTextMessage:Ljava/lang/reflect/Method;

    const/4 v2, 0x5

    new-array v2, v2, [Ljava/lang/Object;

    const/4 v3, 0x0

    aput-object p1, v2, v3

    const/4 v3, 0x1

    aput-object p2, v2, v3

    const/4 v3, 0x2

    aput-object p3, v2, v3

    const/4 v3, 0x3

    aput-object p4, v2, v3

    const/4 v3, 0x4

    aput-object p5, v2, v3

    invoke-virtual {v1, p0, v2}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 514
    :cond_0
    :goto_0
    return-void

    .line 509
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 511
    .local v0, e:Ljava/lang/Exception;
    invoke-static {v0}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto :goto_0
.end method
